proc msg:act {nick host handle arg} {
  global botnick 

  set argument [lindex $arg 0]

  # if channel in argument...
  if {[string match "#*" $argument]} {
    # if valid channel...
    if {[validchan $argument]} {
      set chan $argument
      set botnet [lrange $arg 1 end]
    } else {
      putquick "NOTICE $nick :\0034ERROR - This bot is not in $argument."
      return 0
    }
  } else {
    putquick "NOTICE $nick :\0034ERROR - You need to specify a channel."
    return 0
  }

  # if user is not global or if user is not of sufficient access in the channel
  if {![matchattr $handle o|n $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Permission Denied."
    return 0
  }

  # if user is not authenticated
  if {![matchattr $handle A]} {
    putquick "NOTICE $nick :\0034ERROR - You need to authenticate first - Permission Denied."           
    putquick "NOTICE $nick :\00312You may authenticate yourself by typing \0033\002/msg $botnick auth <your password>\002"
    return 0
  }

  # if user is disabled
  if {[matchattr $handle D]} {
    putquick "NOTICE $nick :\0034ERROR - Permission Denied - Access Is Disabled."
    return 0
  }

  act $nick $chan $host $botnet
  return 0
}









